import java.util.Scanner;

/**
 * @Title: 差分
 * @Author 贾金博
 * @Package PACKAGE_NAME
 * @Date 2024/3/3 20:17
 * @description: 前缀和的逆过程
 */
public class 差分 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] a = new int[n + 10];
        int[] s = new int[n + 10];

        for(int i = 1; i <= n; ++ i ) {
            a[i] = sc.nextInt();
        }
        while(m -- != 0) {
            int l = sc.nextInt();
            int r = sc.nextInt();
            int c = sc.nextInt();
            s[l] += c;
            s[r + 1] -= c;
        }
        for (int i = 1; i <= n; ++ i ) {
            s[i] += s[i - 1];
        }

        for(int i = 1; i <= n; ++ i ) {
            System.out.print(a[i] + s[i] + " ");
        }
    }
}
